Scene Management API
Get Scene List
Request URL
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| page_size | Integer | Body | Yes | Page size |
| page_index | Integer | Body | Yes | Page index |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | []Object<result> | Body | Return result |
result description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| scene_id | String | Body | Scene ID |
| scene_name | String | Body | Scene name |
| enable_auto | Boolean | Body | Whether the scene automation is enable or not? true: enable false: disable |
Request Example
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_scene_list",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"page_size": 1,
"page_index": 1
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"scene_name": "my scene",
"enable_auto": true
}
]
}
Failure Return Example
Get Scene Information
Request URL
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| scene_id | String | Body | Yes | Scene ID |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object<result> | Body | Return result |
result description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| scene_name | String | Body | Scene name |
| triggers | []Object<trigger> | Body | Trigger information |
| actions | []Object<action> | Body | Action information |
trigger description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| trigger_config | String | Body | Trigger config, see Scene Trigger Config |
| trigger_type | String | Body | Trigger type, see Scene Trigger Config |
| room_tag_id | String | Body | Room tag ID |
action description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| action_config | String | Body | Action config, see Scene Action Config |
| ability_type | String | Body | Ability type |
| action_type | String | Body | Action type, see Scene Action Config |
| attribute | Object | Body | Attribute, see Standard Device Model |
Request Example
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_name": "my scene",
"triggers": [
{
"trigger_config": "hotel",
"trigger_type": "check_in",
"room_tag_id": ""
}
],
"actions": [
{
"action_config": "device",
"ability_type": "light",
"action_type": "turn_all_on"
}
]
}
]
}
Failure Return Example
Create Scene Information
Request URL
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| scene_name | String | Body | Yes | Scene name |
| triggers | []Object<trigger> | Body | Yes | Trigger information |
| actions | []Object<action> | Body | Yes | Action information |
trigger description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| trigger_config | String | Body | Yes | Trigger config, see Scene Trigger Config |
| trigger_type | String | Body | Yes | Trigger type, see Scene Trigger Config |
| room_tag_id | String | Body | No | Room tag ID |
action description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| action_config | String | Body | Yes | Action config, see Scene Action Config |
| ability_type | String | Body | Yes | Ability type |
| action_type | String | Body | Yes | Action type, see Scene Action Config |
| attribute | Object | Body | No | Attribute, see Standard Device Model |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object<result> | Body | Return result |
result description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| scene_id | String | Body | Scene ID |
Request Example
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "create_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_name": "test",
"triggers": [
{
"trigger_config": "hotel",
"trigger_type": "check_in"
}
],
"actions": [
{
"action_config": "device",
"ability_type": "light",
"action_type": "turn_all_on"
}
]
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {
"scene_id": "sr31adc223cc4b3bedb6bd4742dedcfa5"
}
}
Failure Return Example
Update Scene Information
Request URL
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| scene_id | String | Body | Yes | Scene ID |
| scene_name | String | Body | Yes | Scene name |
| triggers | []Object<trigger> | Body | Yes | Trigger information |
| actions | []Object<action> | Body | Yes | Action information |
trigger description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| trigger_config | String | Body | Yes | Trigger config, see Scene Trigger Config |
| trigger_type | String | Body | Yes | Trigger type, see Scene Trigger Config |
| room_tag_id | String | Body | No | Room tag ID |
action description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| action_config | String | Body | Yes | Action config, see Scene Action Config |
| ability_type | String | Body | Yes | Ability type |
| action_type | String | Body | Yes | Action type, see Scene Action Config |
| attribute | Object | Body | No | Attribute, see Standard Device Model |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object | Body | Return result |
Request Example
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "update_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "sr31adc223cc4b3bedb6bd4742dedcfa5",
"scene_name": "test",
"triggers": [
{
"trigger_config": "hotel",
"trigger_type": "check_in"
}
],
"actions": [
{
"action_config": "device",
"ability_type": "light",
"action_type": "turn_all_on"
}
]
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
Failure Return Example
Delete Scene Information
Request URL
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| scene_id | String | Body | Yes | Scene ID |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object | Body | Return result |
Request Example
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "delete_scene_info",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db"
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
Failure Return Example
Manual Trigger Scene
Request URL
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| scene_id | String | Body | Yes | Scene ID |
| residences | []Object<residence> | Body | Yes | Residence information |
residence description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| residence_id | String | Body | Yes | Residence ID |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object | Body | Return result |
Request Example
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "manual_trigger_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "s3b5a73f8dd84abaa94dcs248be49b0db",
"residences": [
{
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52"
}
]
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
Failure Return Example
Enable Auto Scene
Request URL
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| scene_id | String | Body | Yes | Scene ID |
| enable_auto | Boolean | Body | Yes | Whether the scene automation is enable or not? true: enable false: disable |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | Object | Body | Return result |
Request Example
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "enable_auto_scene",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"scene_id": "s3b5a73f8dd84abaa94dcs248be49b0db",
"enable_auto": true
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": {}
}
Failure Return Example
Get Scene History
Request URL
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Request Parameter
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| Content-Type | String | Header | Yes | Content type, the value is application/json |
| Accept | String | Header | Yes | Accept, the value is application/json |
| Authorization | String | Header | Yes | Bearer authorization, access token |
| command | String | Body | Yes | Command name |
| id | String | Body | Yes | Command ID |
| param | Object<param> | Body | Yes | Command parameter |
param description
| Parameter Name | Type | Location | Required | Description |
|---|---|---|---|---|
| page_size | Integer | Body | Yes | Page size |
| page_index | Integer | Body | Yes | Page index |
Return Parameter
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| Content-Type | String | Header | Content type, the value is application/json |
| success | Boolean | Body | Whether the request is successful or not? true: success false: failure |
| timestamp | Integer | Body | Timestamp |
| result | []Object<result> | Body | Return result |
result description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| scene_record_id | String | Body | Scene record ID |
| scene_id | String | Body | Scene ID |
| scene_name | String | Body | Scene name |
| trigger_scene | Boolean | Body | Whether the scene triggering is successful or not? true: success false: failure |
| residence_id | String | Body | Residence ID |
| detail | Object<detail> | Body | Detail information |
detail description
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| trigger_config | String | Body | Trigger config, see Scene Trigger Config |
| trigger_type | String | Body | Trigger type, see Scene Trigger Config |
| room_tag_id | String | Body | Room tag ID |
| manual | Boolean | Body | Whether the scene is manual or not? true: yes false: no |
| manual_by | String | Body | Manual by |
Request Example
POST /api/v1.0/invoke/open-ability/method/hotel-commands
Content-Type: application/json
Accept: application/json
Authorization: Bearer ac45e846ca23ab42c9ae469d988ae32a9
{
"command": "get_scene_history",
"id": "c45e846ca23ab42c9ae469d988ae32a96",
"param": {
"page_size": 1,
"page_index": 1
}
}
Success Return Example
Status Code: 200
Content-Type: application/json
{
"success": true,
"timestamp": 1540869200562,
"result": [
{
"scene_record_id": "r8b5a73f8dd84abaa94dcs248be49b0d1",
"scene_id": "s8b5a73f8dd84abaa94dcs248be49b0db",
"scene_name": "my scene",
"trigger_scene": true,
"residence_id": "r31adc223cc4b3bedb6bd4742dedcfa52",
"detail": {
"trigger_config": "hotel",
"trigger_type": "check_in",
"room_tag_id": "",
"manual": false,
"manual_by": ""
}
}
]
}